8.9 Dynamically changing text size
You can apply a formatter to Auto Text boxes to ensure that the text size is reduced to allow the entire field to fit on the card when printed.
Note: The font size is reduced to a minimum of 4; if this is not sufficient, the text may still become truncated or wrap.
To resize the contents of an Auto Text box automatically:
-
In the Card Layout Editor, open the card layout you want to work with.
-
Select the Auto Text box you want to configure.
-
From the Formatter drop-down list, select FitTextFormatter.
-
Save the card layout.
You can also link two Auto Text boxes to ensure that they are scaled by the same amount. The font size of the two fields is reduced by the same percentage so that they both fit inside their respective widths; the font's family, size, and weight of each field may be different, but you are recommended to use the same values for both fields.
For example, to have two elements, First Name and Initial and Surname and Suffix scale by the same amount:
-
Create a custom Auto Text element with a value of [[Firstname]] [[Initial]] set to the maximum required font size.
-
Create a custom Auto Text element with a value of [[Surname]] [[Suffix]] set to the maximum required font size.
-
For each field, from the Formatter drop-down list, select FitTextFormatter.
-
Select the first field, then from the No Larger Than drop-down list, select the second field.
-
Select the second field, then from the No Larger Than drop-down list, select the second field.
Note: For some layouts (for example, the name field on PIV cards) you may need to have more control of the size and position of some text elements than the Card Layout Editor and the FitTextFormatter can provide. MyID provides the ability to use externally-formatted images for these elements; see section 8.5.7, Externally formatted image fields.